﻿using Rsd.Dudu;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rsd.Faith.Report
{
    /// <summary>
    /// 
    /// </summary>
    internal enum ErrorCodesType
    {
        /// <summary>
        /// 分户(房代码：{0})属期核算失败 ：{1}
        /// </summary>
        [System.ComponentModel.Description("分户(房代码：{0})属期核算失败 ：{1}")]
        R10002 = 10002,


        /// <summary>
        /// {0}所属期不存在
        /// </summary>
        [System.ComponentModel.Description("{0}所属期不存在。")]
        R10003 = 10003,

        /// <summary>
        /// 账务未到期(到期时间:{0}),不可扎帐。
        /// </summary>
        [System.ComponentModel.Description("账务未到期(到期时间:{0}),不可扎帐。")]
        R10004 = 10004,
    }


    public static class ExtendMethod
    {
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="code"></param>
        /// <param name="args"></param>
        internal static void SubmitError(this ErrorCodesType code, params String[] args)
        { 
            ServicesContainer.GetService<Rsd.Dudu.Exception.IExceptionService>(null).Submit(code,  Rsd.Dudu.Exception.OperationType.CommitAndError, args);
        }
    }
}
